
part of 'sync_bloc.dart';

class SyncState extends Equatable {
  SyncState({this.fieldInit,this.successInit  , this.pendingInit,this.currentLoading}){
    field = fieldInit??[SyncOperation(endpoint: '', method: '', payload: '', createdAt: DateTime.now())];
    success =successInit?? [];
    pending =pendingInit?? [];
  }
  final List<SyncOperation>? successInit;
  final List<SyncOperation>? fieldInit;
  final List<SyncOperation>? pendingInit;

  List<SyncOperation> success =[];
  List<SyncOperation> field = [];
  List<SyncOperation> pending = [];

  int? currentLoading;

  @override
  List<Object?> get props => [success,pending,field];
  SyncState copyWith({
    List<SyncOperation>? success,
    List<SyncOperation>? field,
    List<SyncOperation>? pending,
    int? currentLoading,
}) {
    return SyncState(
      pendingInit: pending??this.pending,
      successInit: success??this.success,
      fieldInit: field??this.field,
      currentLoading: currentLoading??this.currentLoading,
    );
  }
}
